package com.example.backend.service.mysql.user.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.backend.entitly.mysql.user.AuthMethod;
import com.example.backend.mapper.mysql.user.AuthMethodMapper;
import com.example.backend.service.mysql.user.AuthMethodService;
import org.springframework.stereotype.Service;

/**
 * @author 1
 * @description 针对表【auth_method(认证方式定义表)】的数据库操作Service实现
 * @createDate 2025-06-04 10:09:21
 */
@Service
public class AuthMethodServiceImpl extends ServiceImpl<AuthMethodMapper, AuthMethod>
        implements AuthMethodService {

    @Override
    public Integer getByCode(String code) {
        return new LambdaQueryChainWrapper<>(getBaseMapper())
                .eq(AuthMethod::getCode, code)
                .one().getId();
    }
}




